<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // var arr = [91, 10, 20, 19]
    // var box = []  // 91 20 19

    //    ?  19  20   91

    // for(var i = 0; i < arr.length; i++) {
    //   if(arr[i] > 15) {
    //     box[box.length] = arr[i]
    //   }
    // }

    // console.log(box)

    // var arr = [91, 10, 30, 18, 15, 20, 19]
    // var box = []
    // var index = 0

    // for(var i = 0; i < arr.length; i++) {
    //   if(arr[i] > 15) {
    //     box[index] = arr[i]

    //     index += 1
    //   }
    // }

    // console.log(box)


    var arr = [91, 10, 30, 18, 15, 20, 19]
    var box = []  // 19 20 19 30 91

    for(var i = arr.length - 1; i >= 0; i--) {
      if(arr[i] > 15) {
        box[box.length] = arr[i]
      }
    }

    console.log(box)
  </script>
</body>
</html>